/*
 * WipInventoryAction.java
 *
 * Created on June 9, 2002, 10:02 AM
 */

package com.scalar.chiptrack.operations.reports.actions;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.scalar.chiptrack.ChipTrackAction;
import com.scalar.chiptrack.db.DBTransaction;
import com.scalar.chiptrack.operations.reports.dao.WipInventoryDAO;
import com.scalar.chiptrack.operations.reports.forms.WipInventoryForm;

/**
 *
 * @author  Administrator
 * @version 
 */
public class WipInventoryAction extends ChipTrackAction{

    public ActionForward execute (ActionMapping mapping,
                                      ActionForm form,
                                      HttpServletRequest request,
                                      HttpServletResponse response) 
                                      throws Exception {

            WipInventoryForm wipInventoryForm = (WipInventoryForm)form;
            DBTransaction dbt = null;
            boolean success = false;
            
            try{
                
                dbt = DBTransaction.getInstance();
                dbt.begin();
                WipInventoryDAO.getWipInventoryReport(dbt);
                
                success = true;
                
            }catch(Exception e){
                e.printStackTrace();
            }finally{
                if(success){
                    dbt.commit();
                }else{
                    dbt.rollback();
                }
            }
            
            return null;
       }


}
